import { useUserStore } from "@/store/user";

export const hasButton = (app: any) => {
  app.directive("has", {
    mounted(el: Element, options: any) {
      const userSotre = useUserStore();
      if (!userSotre.user.buttons?.includes(options.value)) {
        el.parentNode?.removeChild(el);
      }
    },
  });
};
